<%@ Page Language="C#" MasterPageFile="~/MuseumOwner.master" AutoEventWireup="true"
    CodeFile="ManageReviews.aspx.cs" Inherits="ManageReviews" Title="Manage Reviews" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%" cellspacing="3" cellpadding="3" border="0">
        <tr>
            <td colspan="3" align="center">
                <b style="font-size: x-large;">REVIEWS</b>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblOption" Text="Option" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlOption" runat="server" Width="200px" 
                    AutoPostBack="true" onselectedindexchanged="ddlOption_SelectedIndexChanged">
                    <asp:ListItem Selected="True" Text="Museum" Value="0"></asp:ListItem>
                    <asp:ListItem Text="School" Value="1"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblMuseumName" Text="Museum/School" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlMuseum" runat="server" Width="200px" DataTextField="MuseumName"
                    DataValueField="MuseumID" AutoPostBack="true" OnSelectedIndexChanged="ddlMuseum_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblGame" Text="Game" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlGame" runat="server" Width="200px" DataTextField="GameName"
                    DataValueField="GameID" AutoPostBack="true" 
                    OnSelectedIndexChanged="ddlGame_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <div id="divGridView">
                    <asp:GridView ID="GridViewReviews" runat="server" EnableViewState="False" Width="100%"
                        BorderWidth="1" CellPadding="4" ForeColor="#333333" GridLines="Both" AutoGenerateColumns="false"
                        DataKeyNames="ReviewMasterID" AutoGenerateDeleteButton="false" EmptyDataText="No records found"
                        AllowPaging="true" AllowSorting="true" PageSize="10" AlternatingRowStyle-BackColor="White"
                        OnPageIndexChanging="gridView_PageIndexChanging" OnSorting="gridView_Sorting"
                        RowStyle-CssClass="record" OnRowDeleting="DeleteRecord">
                        <RowStyle CssClass="record"></RowStyle>
                        <HeaderStyle BackColor="#A59072" HorizontalAlign="Left" Font-Bold="True" ForeColor="White" />
                        <Columns>
                            <asp:BoundField HeaderText="ID" DataField="ReviewMasterID" />
                            <asp:BoundField HeaderText="REVIEW COMMENTS" DataField="ReviewComments"/>
                            <asp:BoundField HeaderText="GAME" DataField="GameName" />
                            <asp:BoundField HeaderText="USER" DataField="UserName" />
                            <asp:BoundField HeaderText="REVIEW RATING" DataField="ReviewRatings" />
                            <asp:TemplateField HeaderText="DELETE">
                                <ItemTemplate>
                                    <span onclick="return confirm('Are you sure to Delete the record?')">
                                        <asp:LinkButton ID="lnkB" runat="Server" Text="Delete" CommandName="Delete"></asp:LinkButton>
                                    </span>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:Label ID="lblMessage" runat="server" ForeColor="Red" Visible="true"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
